package education.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import education.dao.TeacherDao;
import education.model.Teacher;
import education.service.TeacherManager;

@Component("teacherManager")
public class TeacherManagerImpl implements TeacherManager {
	private TeacherDao teacherDao;

	public TeacherDao getTeacherDao() {
		return teacherDao;
	}

	@Resource(name = "teacherDao")
	public void setTeacherDao(TeacherDao teacherDao) {
		this.teacherDao = teacherDao;
	}

	public void delete(Teacher teacher) {
		teacherDao.delete(teacher);
	}

	public boolean delete(int id) {
		return teacherDao.delete(id);
	}

	public int getCount() {
		return teacherDao.getCount();
	}

	public Teacher loadById(int id) {
		return teacherDao.loadById(id);
	}

	public List<Teacher> paging(int pageSize, int pageCount, int rowCount) {
		return teacherDao.paging(pageSize, pageCount, rowCount);
	}

	public void save(Teacher teacher) {
		teacherDao.save(teacher);

	}

	public boolean update(Teacher teacher) {
		return teacherDao.update(teacher);
	}
/**
 * yu
 */
	public List<Teacher> getTeacherList() {
		return teacherDao.getTeacherList();
	}

	public Teacher findByName(String userName) {
		return teacherDao.findByName(userName);
	}

}
